package Cantella::DJabberd::Web::UI::Widget::Field::Collection::Linked;

use Reaction::UI::WidgetClass;

class Linked is 'Reaction::UI::Widget::Field::Collection', which {

  implements fragment list {
    my $vp = $_{viewport};
    if( $vp->has_prototype ){
      render 'linked_item_layout' => over $vp->members;
    } else {
      render 'item' => over $vp->value_names;
    }
  };

  implements fragment item {
    arg 'name' => $_;
  };

  implements fragment linked_item {
    render 'viewport';
  };

};

1;

__END__;
